<nz-card>
  <ng-template #body>
    <div>
      <div style="margin-bottom: 16px;">
        <button nz-button [nzType]="'primary'" (click)="add()">
          <span>新增</span>
        </button>
      </div>

      <nz-table #nzTable
                [nzShowTotal]="true"
                [nzTotal]="total"
                [nzAjaxData]="pageData"
                [nzPageSize]="10"
                (nzPageIndexChangeClick)="refreshPageNum($event)">
        <thead nz-thead>
        <tr>
          <th nz-th><span>标题</span></th>
          <th nz-th><span>标签</span></th>
          <th nz-th><span>分类</span></th>
          <th nz-th><span>作者</span></th>
          <th nz-th><span>时间</span></th>
          <th nz-th><span>操作</span></th>
        </tr>
        </thead>
        <tbody nz-tbody>
        <tr nz-tbody-tr *ngFor="let data of nzTable.data">
          <td nz-td>
            {{data.title}}
          </td>

          <td>
            <nz-tag [nzColor]="'pink'" *ngFor="let tagName of data.sign.split(',')">{{tagName}}</nz-tag>
          </td>
          <td>{{data.classificationNo}}</td>
          <td nz-td>{{data.author}}</td>
          <td nz-td>
            {{data.createTime| date: 'yyyy-MM-dd HH:mm:ss'}}
          </td>
          <td nz-td>
            <nz-popconfirm [nzTitle]="'确定要删除该分类？'" (nzOnConfirm)="delete(data)" (nzOnCancel)="cancel()">
              <a nz-popconfirm>删除</a>
            </nz-popconfirm>
            <a (click)="edit(data.id)">修改</a>
            <a (click)="preView(data.id)">预览</a>
          </td>
        </tr>
        </tbody>
      </nz-table>
    </div>
  </ng-template>
</nz-card>
